package com.itany.springboot.springboot05.entity;

import org.springframework.util.StringUtils;
import sun.applet.Main;

import java.io.Serializable;
import java.util.StringJoiner;

public class User implements Serializable {
    private Integer id;
    private String username;
    private String password;
    private String sex;
    private String edu;
    private String[] hobbies;
    private String description;

    public User() {
    }



    public String getHob(){
        if(hobbies!=null){
            return StringUtils.arrayToDelimitedString(hobbies,",");
        }
        return null;
    }

    public void setHob(String hob){
        if(hob!=null){
            hobbies=hob.split(",");
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getEdu() {
        return edu;
    }

    public void setEdu(String edu) {
        this.edu = edu;
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
